//
//  YCTranstion.m
//  lianganyuchu-user
//
//  Created by iMac on 17/5/19.
//  Copyright © 2017年 杭州桑缇电子商务有限公司. All rights reserved.
//

#import "YCTranstion.h"

@implementation YCTranstion

+ (void)addPresentAnimationType:(NSString*)type time:(CFTimeInterval)time{
    
    //创建动画
    
    CATransition *animation = [CATransition animation];
    
    //设置运动轨迹的速度
    
    animation.timingFunction = UIViewAnimationCurveEaseInOut;
    
    //设置动画类型为立方体动画
    
    animation.type = type;
    
    //设置动画时长
    
    animation.duration =time;
    
    //设置运动的方向
    
    animation.subtype =kCATransitionFromRight;
    
    //控制器间跳转动画
    [[UIApplication sharedApplication].keyWindow.layer addAnimation:animation forKey:nil];    
    
    
}
@end
